package com.lly;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;


public class ServletA extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Cookie cookie1 = new Cookie("keyA", "valueA");
        cookie1.setMaxAge(6*60);
//        cookie1.setPath("/servletB");
        Cookie cookie2 = new Cookie("keyB", "valueB");
        resp.addCookie(cookie1);
        resp.addCookie(cookie2);
    }
}
